/*
 * global.h
 * 
 * Global include for errors and global constants
 *
 */
#ifndef GLOBAL_H
#define GLOBAL_H

// global codes
#define NO_ERROR 0
#define NULL_PTR -10

// process codes
#define NO_PROCESS -1 // needs to be -1 to make process checking easier.
#define DEAD_PROCESS -20 
#define CONTINUE_PROCESS -11

// process types
#define COMPUTE 20  // no IO interrupts
#define IO 21		// only IO interrupts/traps  NETWORK OR DISK
#define UI 22		// any IO interrups/traps, NETWORK, DISK, KEYBOARD, MOUSE
#define PRODUCER 23 // mutex and condition interrupts/traps
#define CONSUMER 24 // mutex and condition interrupts/traps

// scheduler/process blocking codes
#define IO_BLOCK -21
#define MUTEX_BLOCK -22
#define COND_VAR_BLOCK -23
#define KEY_BLOCK -24
#define MOUSE_BLOCK -25

// scheduler codes
#define EMPTY -30
#define FULL -31
#define INVALID_BLOCK_ID -32
#define NOT_WAITING -33
#define MUTEX -35
#define COND_VAR -36
#define NOT_FOUND -37


// scheduler store and retrieve attributes
#define ROUND_ROBIN 30
#define PRIORITY 31
#define STR 32
#define FCFS 33

// Interrupt controller
#define TIMER_INTERRUPT -40
#define NO_INTERRUPT 40

// Device ID's and Request codes
#define TIMER 0 
#define NETWORK 1
#define DISK_IO 2
#define VIDEO 3
#define MOUSE 4
#define KEYBOARD 5
#define MUTEX_REQ 6
#define CV_REQ 7
#define FREE_IO 8
#define FREE_MUTEX 9
#define FREE_CV 10

#define DEVICE_UNAVAIL -41
#define NO_DEVICE -42

#define IDLE 100

#endif
